home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_203 / isam / isam.doc < prev    next >
Text File  |  1992-05-06  |  6KB  |  303 lines

  1.  
  2.                 ISAM0.9 BETA release  -  4/5/1989
  3.                ***********************************
  4.  
  5. Functions: (13)
  6. ==========
  7.  
  8. ISAMAdd
  9. ISAMClose
  10. ISAMDelete
  11. ISAMError
  12. ISAMFirst
  13. ISAMLast
  14. ISAMNext
  15. ISAMOpen
  16. ISAMPrev
  17. ISAMRead
  18. ISAMReplace
  19. ISAMSearch
  20. ISAMUpdate
  21.  
  22.  
  23.  
  24. Descriptions:
  25. =============
  26.  
  27. ISAMOpen
  28. ------------------------------------------------------------------------------
  29.  
  30. Hd = ISAMOpen(new, mode);
  31.  
  32.     struct ISAMHeader *Hd;
  33.  
  34.     struct ISAMNewFile *new;
  35.     USHORT mode;
  36.  
  37.     Hd - pointer to ISAMHeader structure. NULL if error.
  38.  
  39.     mode - ISAM_NEWFILE creates a new file. ISAM_REPLACE replaces an old
  40.            file (with ISAM_NEWFILE only). ISAM_OLDFILE opens an old file
  41.            for read/write access.
  42.  
  43.     new - points to an initialized ISAMNewFile structure
  44.  
  45.  
  46.     This function opens the data file for r/w access, reads the index
  47.     into memory and initializes all necessary structures.
  48.     If you create a new file and want to set the maximum key number,
  49.     put it in ISAMHeader->ISAMKeyHeader.MaxKeys
  50.  
  51.  
  52.  
  53.  
  54. ISAMClose
  55. ------------------------------------------------------------------------------
  56.  
  57. error = ISAMClose(Hd);
  58.  
  59.     int error;
  60.  
  61.     struct ISAMHeader *Hd;
  62.  
  63.     error - NULL if no error occurred, else EOF (-1)
  64.  
  65.     Hd - pointer to ISAMHeader structure.
  66.  
  67.     ISAMClose saves the index to disk (if ISAM_MODIFIED flag set),
  68.     frees all memory allocated for the key list and the structures
  69.     and closes the data file.
  70.  
  71.  
  72.  
  73.  
  74. ISAMUpdate
  75. ------------------------------------------------------------------------------
  76.  
  77. error = ISAMUpdate(Hd);
  78.  
  79.     int error;
  80.  
  81.     struct ISAMHeader *Hd;
  82.  
  83.     error - NULL if no error occurred, else EOF (-1)
  84.  
  85.     Hd - pointer to ISAMHeader structure.
  86.  
  87.     Updates the key list to disk if ISAM_MODIFIED is set. Then
  88.     ISAM_MODIFIED is cleared.
  89.  
  90.  
  91.  
  92.  
  93. ISAMError
  94. ------------------------------------------------------------------------------
  95.  
  96. errnum = ISAMError(Hd);
  97.  
  98.     int errnum;
  99.  
  100.     struct ISAMHeader *Hd;
  101.  
  102.     errnum - error number of last error.
  103.  
  104.     Hd - pointer to ISAMHeader structure.
  105.  
  106.     This function returns the number of the last error.
  107.     Actual Error numbers:
  108.  
  109.  
  110.  
  111.  
  112. ISAMAdd
  113. -------------------------------------------------------------------------------
  114.  
  115. error = ISAMAdd(Hd, data);
  116.  
  117.     int error;
  118.  
  119.     struct ISAMHeader *Hd;
  120.     APTR data;
  121.  
  122.  
  123.     error - NULL if no error occurred, else EOF (-1)
  124.  
  125.     Hd - pointer to ISAMHeader structure
  126.     data - pointer to an initialized data record in memory.
  127.            The data must correspond to the field definitions in the
  128.            ISAMDataHeader structure!
  129.  
  130.  
  131.     This function writes the data in memptr to the data file and adds 
  132.     a new key to key list. Then it sets the ISAM_MODIFIED flag in
  133.     ISAMKeyHeader.
  134.     If the ISAM_AUTOUPDATE flag is specified, ISAMUpdate() is called.
  135.  
  136.  
  137.  
  138.  
  139. ISAMReplace
  140. ------------------------------------------------------------------------------
  141.  
  142. error = ISAMReplace(Hd, data);
  143.  
  144.     int error;
  145.  
  146.     struct ISAMHeader *Hd;
  147.     APTR data;
  148.  
  149.     error - NULL if no error occurred, else EOF (-1)
  150.  
  151.     Hd - pointer to ISAMHeader structure
  152.     data - pointer to an initialized data record in memory.
  153.            The data must correspond to the field definitions in the
  154.            ISAMDataHeader structure!
  155.  
  156.     This function replaces the items of the current record with the new
  157.     ones in data. The new key word must be equal to that in the
  158.     current record!
  159.  
  160.  
  161.  
  162.  
  163. ISAMDelete
  164. ------------------------------------------------------------------------------
  165.  
  166. error = ISAMDelete(Hd);
  167.  
  168.     int error;
  169.  
  170.     struct ISAMHeader *Hd;
  171.  
  172.     error - NULL if no error occurred, else EOF (-1)
  173.     Hd - pointer to ISAMHeader structure.
  174.  
  175.     This function deletes the current record from the file.
  176.  
  177.  
  178.  
  179.  
  180. ISAMRead
  181. ------------------------------------------------------------------------------
  182.  
  183. error = ISAMRead(Hd, data);
  184.  
  185.     int error;
  186.  
  187.     struct ISAMHeader *Hd;
  188.     APTR data;
  189.  
  190.     error - NULL if no error occurred, else EOF (-1)
  191.  
  192.     Hd - pointer to ISAMHeader structure
  193.     data - pointer to an initialized data record in memory.
  194.            The data must correspond to the field definitions in the
  195.            ISAMDataHeader structure!
  196.  
  197.     This function reads the current record into the specified memory.
  198.     The memory space MUST be big enough to hold the whole record!
  199.  
  200.  
  201.  
  202.  
  203. ISAMSearch
  204. ------------------------------------------------------------------------------
  205.  
  206. error = ISAMSearch(Hd, keyword, mode);
  207.  
  208.     int error;
  209.  
  210.     struct ISAMHeader *Hd;
  211.     STRPTR keyword;
  212.     int mode;
  213.  
  214.     error - NULL if no error occurred, else EOF (-1)
  215.  
  216.     Hd - pointer to ISAMHeader structure
  217.     keyword - string pointer to the key word to search for
  218.     mode - searching mode
  219.  
  220.     This function searches for the specified keyword in the key list.
  221.  
  222.  
  223.  
  224.  
  225. ISAMFirst
  226. ------------------------------------------------------------------------------
  227.  
  228. error = ISAMFirst(Hd);
  229.  
  230.     int error;
  231.  
  232.     struct ISAMHeader *Hd;
  233.  
  234.     error - NULL if no error occurred, else EOF (-1)
  235.  
  236.     Hd - pointer to ISAMHeader structure
  237.  
  238.     This function makes the first 'real' key current, that is, the first
  239.     key that contains information. If there is no 'real' record in the key
  240.     list, an error is returned.
  241.  
  242.  
  243.  
  244.  
  245. ISAMLast
  246. ------------------------------------------------------------------------------
  247.  
  248. error = ISAMLast(Hd);
  249.  
  250.     int error;
  251.  
  252.     struct ISAMHeader *Hd;
  253.  
  254.     error - NULL if no error occurred, else EOF (-1)
  255.  
  256.     Hd - pointer to ISAMHeader structure
  257.  
  258.     This function makes the last key current. If there are no keys in the
  259.     list, an error is returned.
  260.  
  261.  
  262.  
  263.  
  264. ISAMNext
  265. ------------------------------------------------------------------------------
  266.  
  267. error = ISAMNext(Hd);
  268.  
  269.     int error;
  270.  
  271.     struct ISAMHeader *Hd;
  272.  
  273.     error - NULL if no error occurred, else EOF (-1)
  274.  
  275.     Hd - pointer to ISAMHeader structure
  276.  
  277.     This function makes the next key in the list current. If there are no
  278.     more keys or the current key is no valid 'real' key, an error is
  279.     returned.
  280.  
  281.  
  282.  
  283.  
  284. ISAMPrev
  285. ------------------------------------------------------------------------------
  286.  
  287. error = ISAMPrev(Hd);
  288.  
  289.     int error;
  290.  
  291.     struct ISAMHeader *Hd;
  292.  
  293.     error - NULL if no error occurred, else EOF (-1)
  294.  
  295.     Hd - pointer to ISAMHeader structure
  296.  
  297.     This function makes the previous key in the list current. If there are
  298.     no more keys or the current key is no valid 'real' key, an error is
  299.     returned.
  300.  
  301.  
  302.  
  303.